package com.wangyadong.hobby.schedule.jobtask.ath;

public class ReverseBit {


    public int reverseBit(int n) {
        int j = 0;
        for (int i = 0; i < 32; i++) {
            System.out.println("index=" + i + " 右移:" + (n >> i));
            j = (j << 1) + ((n >> i) & 1);
        }
        return j;
    }

    public static void main(String[] args) {
        int index = 222;
        ReverseBit reverseBit = new ReverseBit();
        int i1 = reverseBit.reverseBit(index);
        System.out.println(Integer.toBinaryString(index));
        System.out.println(Integer.toBinaryString(i1));


    }


    public void totalOne(int x) {

    }

}
